package xyz.kongbai121.drawingbed.scheduled;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import xyz.kongbai121.drawingbed.utils.OverImagesDeleteUtil;

/**
 * 每晚2点删除已删除的图片文件
 */
@Slf4j
@Service
public class OverImagesDelete {

    @Autowired
    private OverImagesDeleteUtil overImagesDeleteUtil;

    @Scheduled(cron = "0 0 2 * * ?")
    public void overImagesDelete(){
        overImagesDeleteUtil.imagesDelete();
    }
}
